<div class="title-bar">
    <h5>租户管理</h5>
    <div class="actions">
        <div class="btn blue" [routerLink]="['./create']">添加租户</div>
    </div>
</div>

<div class="main">
    <table class="table hover">
        <thead>
            <tr>
                <th>租户名称</th>
                <th>公司名称</th>
                <th>创建用户</th>
                <th>用户所属组织</th>
                <th>活动数</th>
                <th>余额</th>
                <th>信用额度</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>

        <tbody>
            <tr *ngFor="let tenant of tenants">
                <td>
                    <a [routerLink]="['/tenants', tenant.tenantId]">{{tenant.tenantName}}</a>
                </td>
                <td>{{tenant.companyName}}</td>
                <td>{{tenant.adminName}}</td>
                <td>
                    <em>{{tenant?.agencyName}}</em>
                    <em>（{{tenant?.agencyId ? '代理' : '管理'}}）</em>
                </td>
                <td>{{tenant.activityNum}}</td>
                <td>{{tenant.balance}}</td>
                <td>{{tenant.credit}}</td>
                <td>{{tenant.status | name: 'TENANT' }}</td>
                <td>
                    <button class="btn {{tenant.status ? 'white' : 'blue_outer' }}" (click)="activeness(tenant)">
                        {{tenant.status ? '禁用' : '恢复' }}
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
</div>

